SetTextPr
Sets the paragraph text properties.
Syntax
expression.SetTextPr(oTextPr);
expression
- A variable that represents a ApiParagraph class.
Parameters
Name | Required/Optional | Data type | Default | Description |
---|---|---|---|---|
oTextPr | Required | ApiTextPr | The paragraph text properties. |
Returns
boolean
Example
This example sets the paragraph text properties.
let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("This is a sample text with the font size set to 30 and the font weight set to bold.");
let textPr = Api.CreateTextPr();
textPr.SetFontSize(30);
textPr.SetBold(true);
paragraph.SetTextPr(textPr);